Index
WinScheduler “How To” Help File
[ Other files:  Main Help, Commands Index ]

How to:	General Show / hide main window Password protect data Items Run macros Add macro item Record macro item Add window specific item See all items from all folders Create shared items Folders Add folder Macros Write macros Write reliable macros


Add macro item

Macros can help you to automate many boring and repetitive tasks.  There are many commands that allow you to automate almost all aspects of your every day computing.  Description of each command is available in “Commands Index” help file.

1.  Show program’s main window on the screen.

2.  In the tree, navigate to folder you want to add new item to.

3.  Click “Insert / Add macro item” menu item or press Ctrl+I hotkey.

4.  In the dialog box shown, go to “Macro” tab.

5.  Use “Add” and “Insert” buttons of “Available Commands” window to create your macro.

6.  Define additional options if required (item name, icon, etc.).

7.  Press OK button.


Record macro item

Recording is other way to create macro.  During macro recording, keyboard and/or mouse input is saved and can be repeated any time later.

1.  Show program’s main window on the screen.

2.  In the tree, navigate to folder you want to add new item to.

3.  Click “Insert / Record macro item” menu item or press Ctrl+R hotkey.

4.  In the dialog box shown, specify all the macro recording options.

5.  Press “Record Now!”button.

6.  Do all the keyboard/mouse actions you want to record.

7.  When you are done, click on “Stop” button in the “Macro recording” window in lower right area of the screen. (Or press user defined hotkey to start/stop macro recording.  The hotkey is defined in the main options (“Tools/Options”).  It is Shift+Alt+R by default.)

8.  Define additional options if required (item name, icon, etc.) in the dialog box shown.

9.  Press OK button.

Note:  It is not necessary to show main window on the screen to record macro.  You can do also this:

1.  Right click on the program’s tary icon.

2.  In the menu shown, select “Record macro” item

… and continue to point 4. above.

Or you can also

1.  Press user defined hotkey to start macro recording.  The hotkey is defined in the main options (“Tools/Options”).  It is Shift+Alt+R by default.

… and continue to point 4. above.


Show/Hide main window

Most of the time user uses the program it runs hidden in Taskbar’s tray area.  The program doesn’t occupy any space on screen nor in the Taskbar.

To show window, click on the program’s icon in the Taskbar tray area or press user defined hotkey.  (User can define this hotkey in main options dialog box.  It is Ctrl+Shift+Alt+K by default.)

To hide window, click on the “Close” or “Minimize” button in the upper right corner of the window or press user defined hotkey (it is Ctrl+Shift+Alt+K by default).


Add window specifi item
Add window specific item

Window specific item is available only in some window(s) while in other windows (applications) the hotkey or text shortcut does not start macro.  This allows you to define different macros that are triggered in different applications by the same hotkey or text shortcut.

1.  Show program’s main window on the screen.

2.  Add new folder that will collect items specific to a particular window.

3.  Select the folder and open “Folder properties dialog by “Edit/Edit” menu item.

4.  Go to “Applications” tab.

5.  Select “Listed below only” in the “Items from this folder…” control and, to the edit boxes, insert title * of window(s) you want the items to be available.  (Note there is a special syntax that allows you to define also a child window – read carefully Folder properties section of the help.)

6.  Press OK.

7.  Add items (see how to add a macro item, for example) to this folder.  The items will only work in the applications with the window’s title bar that matches what you have inserted in the step 5.

*Note:  Do not insert path to the executable file here.  You can specify just part of the window’s title.  For example, if the window’s title is “Readme.txt – Notepad” you can specify just “Readme”.


Add folder

1.  Show program’s main window on the screen.

2.  In the tree, navigate to a folder.

3.  Right click on the selected folder.  From the menu shown select:

a)  “Add folder” in order to add new folder on the same level as selected folder.

b)  “Add sub-folder” in order to add a child to the selected folder.

4.  In the dialog box shown, insert name of the folder, select icon and define other folder settings required.

5.  Press OK button.


Add submenu

1.  Right click on any toolbar button, submenu button or toolbar’s empty area.

2.  In the menu shown, select “Add/Add Submenu” item.

3.  In the dialog box shown, insert name and select icon.

4.  Press OK button.


See all items from all folders

Some times, it is convenient to be able to see all items in one view with ability to sort the items by name, hotkey, etc.  You can do this by several ways:

1.  Right click on the program’s tray icon.

2.  From the menu shown, select “All items list” item.

You can sort items by clicking on a column header.

Other way how to get this window is using user defined hotkey (“Find item” hotkey in the main options dialog box) or using “Edit/Find item” menu item.


Create shared items

Shared items can be used by multiple users on the local area network.  Shared items are saved in a separate file.  To create and setup shared items follow these steps”

1.  Create a new file using “File/New” menu command

2.  Add items you want to be shared among users.

3.  Save the file (the name will be, for example, “shared”) on a network drive all other users can also access from their computers.

4.  In the program on each workstation enable shared items – go to the main options dialog box and check “Allow shared items” and specify the path to the “shared” file on the network drive.

Note:  Read more about how to edit shared items.


Write Reliable Macros

Timing issue is very important to consider when writing (more complex) macros.  It may happen that some macros do not work properly just because of timing issue.  Commands you can use to justify macro timing are describe in the “Macro Flow Control” section of the Commands Index help file. There are a few advises that should help you to write macros that are more reliable:

1.  Some time an application the macro runs in is too slow to process all the input in time.  In such case it can help to use <wx>(250) command that stops macro execution for 250ms and gives the application time to process previous input before the macro continues.

2.  If you write a macro that starts an application and then sends input into it, it is necessary to wait until the application loads.  You can use <waitfor> command right after the command you use to start the application.  The <waitfor> command waits until specified window appears on the screen or until it times out.  Because of the possible timeout, it is recommended to use <if_win> command to check if the desired window is opened (activated).

3.  If you write a macro that copies and pastes some selected data (text, bitmap, etc.) using clipboard, it is necessary to check that the data are copied into the clipboard before continuing the macro (paste).  To do this use <waitfor> and <if_clp> commands.

4.  If you write a macro that copies/moves files then use <if_file> and <if_dir> commands to check that the files/directories really exist.


Write Macros

There are basically two types of macros:  (i) macros that send keys to other application in order to fill a form or place a text into it and (ii) macros that consist of commands to copy files, send e-mails, do FTP stuff, open applications, etc.

(i) These macros are typically used to insert larger texts or fill forms quickly.  The macros mostly consist of plain text combined with special keys (Tab, Home, Page down, etc.) if necessary.  Because the macros are typically very simple, there are no special guidelines the user should follow.

EXAMPLE:  This macro fills simple form consisting of three items (name, e-mail and telephone number):

John Smith<tab>smith@web.net<tab>0443 21 34 78

(ii) When writing a macro that mostly consists of commands it is highly recommended to use <commands_only_on> and <commands_only_off> directives (read more in Commands Index).  Only commands (<…>) between the directives are executed while all other text is ignored (as a comment).  This allows a user to better format the macro (when viewed as a raw source text) and highly increases its readability.

It is also highly recommended to comment (<#> followed by comment) more complex macros.  There are also other recommendation concerning macro reliability that are worth to follow.

EXAMPLE:

<commands_only_on>

<#> This macro deletes ‘c:\temp.txt’ file

<if_file>("c:\temp.txt","EXIST","") <#> Does file exist >

   <varset>("vDelete=YES/NO","Are you sure you want to delete 'c:\temp.txt' file?")

   <if_str>("vDelete==YES") <#> Is user sure to delete it?

      <filedel>("c:\temp.txt",0,0)

      <if_file>("c:\temp.txt","NOTEXIST","") <#> Is file deleted OK?

          <msg>(100,100,"File deleted.","Message",1)

      <else>

          <msg>(100,100,"File delete FAILED!.","Message",1)

      <endif>

   <endif>

<else>

   <msg>(100,100,"File 'c:\temp.txt' does not exist.","Message",1)

<endif>

To read step-by-step instructions how to add macro item click here.


Password Protect Data

Data are protected on folder level.  This means that you can have some data protected (items under the protected folder) and other ones not.  Follow these steps to protect your data in the given folder:

1.  Show program’s main window on the screen.

2.  In the tree, navigate to the desired folder.

3.  Right click on the selected folder.  From the menu shown select “Properties” item

4.  In the dialog box shown, click on “Password” button.

5.  Insert your password, check “Enable” check box and press OK button.